* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .realtime-controls {
        width: 100%;
        justify-content: center;
    }

    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .file-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .area-panel {
        padding: 10px;
        margin-bottom: 10px;
    }

    .log-line {
        padding: 10px 15px;
        font-size: 12px;
    }
}

.area-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 15px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(72, 187, 120, 0.4);
}

.result-header {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 20px 30px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.log-content {
    max-height: 700px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.log-line {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.3);
    white-space: pre-wrap;
    word-break: break-all;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 2px 0;
}

.log-line:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.log-line.error {
    background: linear-gradient(90deg, rgba(245, 101, 101, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-left: 4px solid #f56565;
    border-radius: 0 8px 8px 0;
}

.log-line.warn {
    background: linear-gradient(90deg, rgba(237, 137, 54, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-left: 4px solid #ed8936;
    border-radius: 0 8px 8px 0;
}

.log-line.info {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
}

.pagination {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.pagination-info {
    color: #666;
}

.pagination-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pagination-controls input {
    width: 60px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-size: 16px;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error {
    background: linear-gradient(135deg, rgba(245, 101, 101, 0.1) 0%, rgba(229, 62, 62, 0.05) 100%);
    color: #c53030;
    padding: 20px;
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid rgba(245, 101, 101, 0.2);
    font-weight: 500;
}

.no-logs {
    text-align: center;
    padding: 60px;
    color: #718096;
    font-style: italic;
    font-size: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 15px;
    border: 2px dashed rgba(102, 126, 234, 0.2);
}

.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.file-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.file-item:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 1);
}

.file-item.selected {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.2);
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.file-info {
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.hidden {
    display: none;
}

.realtime-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-left: auto;
}

.status-indicator {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
}

.status-indicator::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.status-indicator.connected::before {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    opacity: 0.3;
}

.status-indicator.disconnected {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.status-indicator.disconnected::before {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    opacity: 0.3;
}

.status-indicator.monitoring {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.status-indicator.monitoring::before {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    opacity: 0.3;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.1;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

.realtime-log-content {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f8f9fa;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.realtime-log-line {
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    white-space: pre-wrap;
    word-break: break-all;
    animation: fadeIn 0.3s ease-in;
}

.realtime-log-line:last-child {
    border-bottom: none;
}

.realtime-log-line.new {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-toggle {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(237, 137, 54, 0.3);
}

.btn-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(237, 137, 54, 0.4);
}

.btn-toggle.active {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

.btn-toggle.active:hover {
    box-shadow: 0 15px 35px rgba(72, 187, 120, 0.4);
}

.connection-status {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* 选择文本样式 */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: #2d3748;
}

/* 焦点样式 */
*:focus {
    outline: none;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}